// 商品详情请求数据
import instance from "@/request/request"
// 根据id获取商品详情
export const getOrderDetailById = (id: number): RES<IOrderDetailResultModel> => {
  return instance({
    url: `order/${id}`
  })
}

// 备注订单
export const updateNoteById = (params: { id: string, note: string, status: number }): RES<number> => {
  return instance({
    url: "order/update/note",
    method: "POST",
    params
  })
}
// 关闭订单/批量关闭订单
export const closeOrderByIds = (params: { ids: string, note: string }): RES<number> => {
  return instance({
    url: "order/update/close",
    method: "POST",
    params
  })
}

// 修改订单费用信息
export const updateMoneryInfo = (data: { discountAmount: number, freightAmount: number, orderId: string, status: number }): RES<number> => {
  return instance({
    url: "order/update/moneyInfo",
    method: "POST",
    data
  })
}

// 修改收货人信息
export const updateReceiverInfo = (data: IUpdateReceiverInfoParamsModel): RES<number> => {
  return instance({
    url: "/order/update/receiverInfo",
    method: "POST",
    data
  })
}